package com.itheima.service.omsService.impl;

import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.domain.db.oms.OmsOrderOperateHistory;
import com.itheima.mapper.omsMapper.OrderOperateHistoryMapper;
import com.itheima.service.omsService.OrderOperateHistoryService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author DogeGuo
 */
@DubboService
public class OrderOperateHistoryServiceImpl extends ServiceImpl<OrderOperateHistoryMapper, OmsOrderOperateHistory>
        implements OrderOperateHistoryService {
    @Autowired
    private OrderOperateHistoryMapper mapper;

    /**
     * 根据订单id查询操作记录
     *
     * @param id
     * @return
     */
    @Override
    public List<OmsOrderOperateHistory> findByOrderId(Integer id) {
        LambdaQueryWrapper<OmsOrderOperateHistory> wrapper = new LambdaQueryWrapper();

        wrapper.eq(OmsOrderOperateHistory::getOrderId, Convert.toLong(id));
        List<OmsOrderOperateHistory> list = mapper.selectList(wrapper);
        return list;
    }
}
